<?php 
	function create_wordpress_admin_footer_submenu()
	{
		add_submenu_page( 'my-top-level-handle', 'Footer Options', 'Footer Options', 'manage_options', 'my-submenu-footer-handle', 'footer_admin_page');
		add_action('admin_init', 'register_footer_settings');
	}
	
	function register_footer_settings()
	{
		register_setting( 'footer_options', 'above_footer_active' );
		register_setting( 'footer_options', 'widget_displacement' );
		register_setting( 'footer_options', 'copyright' );
		
		register_setting( 'footer_options', 'footer_sharing' );
		register_setting( 'footer_options', 'footer_sharing_icon_size' );
		register_setting( 'footer_options', 'footer_sharing_text' );
	
		register_setting( 'footer_options', 'footer_sharing_twitter' );
		register_setting( 'footer_options', 'footer_sharing_facebook' );
		register_setting( 'footer_options', 'footer_sharing_google' );
		register_setting( 'footer_options', 'footer_sharing_yahoo' );
		register_setting( 'footer_options', 'footer_sharing_skype' );
		register_setting( 'footer_options', 'footer_sharing_myspace' );
		register_setting( 'footer_options', 'footer_sharing_rss' );
		register_setting( 'footer_options', 'footer_sharing_deviantart' );
		register_setting( 'footer_options', 'footer_sharing_flickr' );
		register_setting( 'footer_options', 'footer_sharing_dribbble' );
		register_setting( 'footer_options', 'footer_sharing_youtube' );
		register_setting( 'footer_options', 'footer_sharing_vimeo' );
		
		register_setting( 'footer_options', 'google_analytics' );
		register_setting( 'footer_options', 'custom_css' );
		register_setting( 'footer_options', 'google_bots_in_search' );
		
	}
	
	function footer_admin_page() {
?>	
<script type="text/javascript">

	jQuery(document).ready(function() {
		jQuery("#footer_tabs").tabs();
		jQuery(".transform").jqTransform();

	});
</script>
<div class="wrap">  
    <div id="icon-options-general" class="icon32"><br /></div>
    <h2>Footer Options</h2>

 	<?php
	$get_admin_warnings = admin_warnings();
	if ( $get_admin_warnings != '' )
	{
		echo '<div id="admin_warnings">';
			echo '<div id="admin_warning_icon"></div>';
			echo $get_admin_warnings;
		echo '</div>';
	}
	?>
    
<div id="footer_tabs" class="admin_tabs">
    <ul>
        <li>
            <a href="#tab_footer_settings">
                Settings
            </a>
        </li>
        <li>
            <a href="#tab_footer_sharing">
                Footer Sharing
            </a>
        </li>
        <li>
            <a href="#tab_footer_advanced">
                Advanced Settings
            </a>
        </li>
    </ul>


	<form method="post" action="options.php" class="transform">
    <?php settings_fields('footer_options'); ?> 
    
	<div id="tab_footer_settings"> 
    
        <div class="settings_wrapper">
            <div class="header">
                Footer Widgets
            </div>
            
            <div class="row_data">
                <div class="row clearfix alternate">
                    <label>Enable Footer Widgets</label>
                    <select name="above_footer_active" class="general_options_select">
                        <option value="yes" <?php if ( get_option('above_footer_active') == 'yes' ) echo ' selected="selected"'; ?>>Yes</option>
                        <option value="no" <?php if ( get_option('above_footer_active') == 'no' ) echo ' selected="selected"'; ?>>No</option>
                    </select>
                </div>
                
                <div class="row clearfix">
                    <label>Widget Displacement:</label>
                    <select name="widget_displacement" class="general_options_select">
                        <option value="1_widget"  <?php if ( get_option('widget_displacement') == '1_widget' )  echo ' selected="selected"'; ?>>1 Widget</option>
                        <option value="2_widgets" <?php if ( get_option('widget_displacement') == '2_widgets' ) echo ' selected="selected"'; ?>>2 Widgets</option>
                        <option value="3_widgets" <?php if ( get_option('widget_displacement') == '3_widgets' ) echo ' selected="selected"'; ?>>3 Widgets</option>
                        <option value="4_widgets" <?php if ( get_option('widget_displacement') == '4_widgets' ) echo ' selected="selected"'; ?>>4 Widgets</option>
                        <option value="5_widgets" <?php if ( get_option('widget_displacement') == '5_widgets' ) echo ' selected="selected"'; ?>>5 Widgets</option>
                        <option value="6_widgets" <?php if ( get_option('widget_displacement') == '6_widgets' ) echo ' selected="selected"'; ?>>6 Widgets</option>
                        <option value="one_half_two_forths" <?php if ( get_option('widget_displacement') == 'one_half_two_forths' ) echo ' selected="selected"'; ?>>1 Half - 2 Forths</option>
                        <option value="two_forths_one_half" <?php if ( get_option('widget_displacement') == 'two_forths_one_half' ) echo ' selected="selected"'; ?>>2 Forths - 1 Half</option>
                        <option value="one_half_three_sixths" <?php if ( get_option('widget_displacement') == 'one_half_three_sixths' ) echo ' selected="selected"'; ?>>1 Half - 3 Sixths</option>
                        <option value="three_sixths_one_half" <?php if ( get_option('widget_displacement') == 'three_sixths_one_half' ) echo ' selected="selected"'; ?>>3 Sixths - 1 Half</option>
                        <option value="one_third_two_thirds" <?php if ( get_option('widget_displacement') == 'one_third_two_thirds' ) echo ' selected="selected"'; ?>>1 Third - 2 Thirds</option>
                        <option value="two_thirds_one_third" <?php if ( get_option('widget_displacement') == 'two_thirds_one_third' ) echo ' selected="selected"'; ?>>2 Thirds - 1 third</option>
                    </select>
                </div>
                
                <div class="row clearfix alternate">
                    <label>Copyright Text:</label>
                    <textarea class="input_box" rows="8" cols="200;" name="copyright"><?php echo get_option('copyright'); ?></textarea>
                </div>
                
                <div class="row clearfix">
                	<input name="Submit" type="submit" class="save_button" value="<?php esc_attr_e('Save Changes'); ?>" />
                </div>
            </div>
            
            <div class="footer">
                Footer Widgets
            </div>
        </div>
    </div>  <!-- END tab_footer_settings -->
    
    
   
	<div id="tab_footer_sharing">   
        <div class="settings_wrapper">
            <div class="header">
                Footer Sharing
            </div>
            <div class="row_data">
            
                <div class="row clearfix alternate">
                    <label>Enable Footer Sharing</label>
                    <select name="footer_sharing" class="general_options_select">
                        <option value="yes" <?php if ( get_option('footer_sharing') == 'yes' ) echo ' selected="selected"'; ?>>Yes</option>
                        <option value="no" <?php if ( get_option('footer_sharing') == 'no' ) echo ' selected="selected"'; ?>>No</option>
                    </select>
                </div>
                
                <div class="row clearfix">
                    <label>Icon size</label>
                    <select name="footer_sharing_icon_size" class="general_options_select">
                        <option value="small" <?php if ( get_option('footer_sharing_icon_size') == 'small' ) echo ' selected="selected"'; ?>>Small</option>
                        <option value="big" <?php if ( get_option('footer_sharing_icon_size') == 'big' ) echo ' selected="selected"'; ?>>Big</option>
                    </select>
                </div>
            
                <div class="row clearfix alternate">
                    <label>Follow us text</label>
                    <input type="text" name="footer_sharing_text" class="input_box" value="<?php echo get_option('footer_sharing_text'); ?>" />
                </div>
                
                <div class="row clearfix">
                    <label>Twitter</label>
                    <input type="text" name="footer_sharing_twitter" class="input_box" value="<?php echo get_option('footer_sharing_twitter'); ?>" />
                </div>
                
                <div class="row clearfix alternate">
                    <label>Facebook</label>
                    <input type="text" name="footer_sharing_facebook" class="input_box" value="<?php echo get_option('footer_sharing_facebook'); ?>" />
                </div>
    
                <div class="row clearfix">
                    <label>Google</label>
                    <input type="text" name="footer_sharing_google" class="input_box" value="<?php echo get_option('footer_sharing_google'); ?>" />
                </div>
                
                <div class="row clearfix alternate">
                    <label>Yahoo</label>
                    <input type="text" name="footer_sharing_yahoo" class="input_box" value="<?php echo get_option('footer_sharing_yahoo'); ?>" />
                </div>
                
                <div class="row clearfix">
                    <label>Skype</label>
                    <input type="text" name="footer_sharing_skype" class="input_box" value="<?php echo get_option('footer_sharing_skype'); ?>" />
                </div>
                
                <div class="row clearfix alternate">
                    <label>MySpace</label>
                    <input type="text" name="footer_sharing_myspace" class="input_box" value="<?php echo get_option('footer_sharing_myspace'); ?>" />
                </div>
                
                <div class="row clearfix">
                    <label>RSS</label>
                    <input type="text" name="footer_sharing_rss" class="input_box" value="<?php echo get_option('footer_sharing_rss'); ?>" />
                </div>
                
                <div class="row clearfix alternate">
                    <label>DeviantArt</label>
                    <input type="text" name="footer_sharing_deviantart" class="input_box" value="<?php echo get_option('footer_sharing_deviantart'); ?>" />
                </div>
                
                <div class="row clearfix">
                    <label>Flickr</label>
                    <input type="text" name="footer_sharing_flickr" class="input_box" value="<?php echo get_option('footer_sharing_flickr'); ?>" />
                </div>
                
                <div class="row clearfix alternate">
                    <label>Dribbble</label>
                     <input type="text" name="footer_sharing_dribbble" class="input_box" value="<?php echo get_option('footer_sharing_dribbble'); ?>" />
                </div>
                
                <div class="row clearfix">
                    <label>Youtube</label>
                    <input type="text" name="footer_sharing_youtube" class="input_box" value="<?php echo get_option('footer_sharing_youtube'); ?>" />
                </div>
                
                <div class="row clearfix alternate">
                    <label>Vimeo</label>
                    <input type="text" name="footer_sharing_vimeo" class="input_box" value="<?php echo get_option('footer_sharing_vimeo'); ?>" />
                </div>
                
                <div class="row clearfix">
                	<input name="Submit" type="submit" class="save_button" value="<?php esc_attr_e('Save Changes'); ?>" />
    			</div>
            </div>
            <div class="footer">
                Footer Sharing
            </div>
        </div>
    </div> <!-- END tab_footer_sharing -->
   
    
    <div id="tab_footer_advanced">
        <div class="settings_wrapper">
            <div class="header">
                Advanced Settings
            </div>
            <div class="row_data">

                <div class="row clearfix alternate">
                    <label>Custom CSS</label>
                    <textarea class="input_box" rows="8" cols="200;" name="custom_css"><?php echo get_option('custom_css'); ?></textarea>
                </div>
                
                <div class="row clearfix">
                    <label>Google Analytics Script</label>
                    <textarea class="input_box" rows="8" cols="200;" name="google_analytics"><?php echo get_option('google_analytics'); ?></textarea>
                </div>
                
                <div class="row clearfix alternate">
                    <label>Google Bots in Search</label>
                    <select name="google_bots_in_search" class="general_options_select">
                    	<option value="no" <?php if ( get_option('google_bots_in_search') == 'no' ) echo ' selected="selected"'; ?>>No</option>
                        <option value="yes" <?php if ( get_option('google_bots_in_search') == 'yes' ) echo ' selected="selected"'; ?>>Yes</option>
                    </select>
                </div>
                
                <div class="row clearfix">
                    <input name="Submit" type="submit" class="save_button" value="<?php esc_attr_e('Save Changes'); ?>" />
                </div>
                
            </div>
            <div class="footer">
                Advanced Settings
            </div>
        </div>

    </div> <!-- tab_footer_advanced -->
    </form>
    
</div> <!-- #footer_tabs -->
    

    
</div> <!-- END  .wrap  --> 
    
<?php
	}
?>